class Qh{
    constructor(el,options={}){
        this.el = document.querySelector(el)
        this.liObj = this.el.querySelectorAll("ul li")
        this.imgObj = this.el.querySelector(".img")
        this.enlargeObj = this.el.querySelector('.enlarge')
        this.init()
    }
    

    init(){
        this.click()
    }

    click(){
        this.liObj.forEach((item,i) => {
            item.onclick = () => {
                this.el.querySelector("ul li.active").className = ""
                item.className = "active"
                let imgNum = item.getAttribute("imgname")
                console.log(imgNum,item)
                this.imgObj.style.background=`url(./imgs/${imgNum}.jpg) no-repeat`
                this.enlargeObj.style.background=`url(./imgs/${imgNum}.big.jpg) no-repeat`
            }
        });
        
    }
}
export default Qh


